package com.dg11185.nearshop.net.request;

import com.dg11185.libs.utils.MD5.MD5Utils;
import com.dg11185.nearshop.app.Constants;
import com.dg11185.nearshop.net.HttpCacheRequest;
import com.dg11185.nearshop.net.response.GetUserDetailResponse;

/**
 * 获取会员详情
 * 
 * @author wanliang527
 * @date 2014-4-29
 */
public class GetUserDetailRequest extends HttpCacheRequest<GetUserDetailResponse> {

    /**
     * 
     * @param loginName
     *            可以是用户名、手机或者邮箱
     */
    public GetUserDetailRequest(String userId) {
        super(Constants.ADDRESS, Constants.getDetail);
        addParam("userId", userId);
        addParam("chshToken", Constants.TOKEN);
        addParam("chshSign", MD5Utils.getMD5Str(getParams(), Constants.MD5_key));
    }

    @Override
    protected GetUserDetailResponse parseJson(String response) throws Exception {
        GetUserDetailResponse res = new GetUserDetailResponse();
        res.parseJson(response);
        return res;
    }

}
